import axios from "axios";
import {useRoute} from "vue-router";

const api = axios.create({
  baseURL:'http://localhost:8090',
  timeout: 5000
});


class PassengerService{
  private router = useRoute();

  //查询用户信息
  async selectAll(current: number,size: number){
    try {
      const respone = await api.get(`/passenger/selectAll`,{
        params:{
          current,
          size
        }
      });
      return respone.data;
    }catch(error){
      console.error('查询失败',error);
      throw error;
    }
  }

}

export const orderService = new PassengerService();
